*** Appendix 7b: Create regression tables for regressions on which Figure 4 and 5 are based
	*** Note: Latex code produced here was additionally edited by hand

	*** 1. section: Regressions for foreign issues
	*** 2. section: Export tables for foreign issues
	*** 3. section: Regressions for internal/IO issues
	*** 4. section: Export tables for internal/IO issues

use  data_long.dta, clear


*Define locals

local controls1 "age female educ_secondary educ_prof_high educ_acad_high i.exp"
local controls2a "authoritarian conspiracy_sum	know_sum	pred_bundes_gov_r	pred_Russia_r	" // for total sample
local controls2b "				conspiracy_sum	know_sum	pred_bundes_gov_r	pred_Russia_r	" // for for authoritarian beliefs
local controls2c "authoritarian					know_sum	pred_bundes_gov_r	pred_Russia_r	" // for conspiracy beliefs
local controls2d "authoritarian conspiracy_sum				pred_bundes_gov_r	pred_Russia_r	" // for knowledge
local controls2e "authoritarian conspiracy_sum know_sum 						pred_Russia_r	" // for att twd German gov
local controls2f "authoritarian conspiracy_sum know_sum		pred_bundes_gov_r					" // for att twd Russia



***************************************************************

*** Secion 1: Regressions, FOREIGN POLICY ONLY

***************************************************************

*Average effect, experiments on foreign policy
mixed poolexp i.treat_exp `controls1' `controls2a' || lfdn: if exp_issuetype == 1
estimates store m1

*By authoritarian beliefs, experiments on foreign policy
mixed poolexp i.treat_exp##c.authoritarian `controls1' `controls2b' || lfdn: if exp_issuetype == 1
estimates store m2

*By conspiracy theory beliefs, experiments on foreign policy
mixed poolexp i.treat_exp##c.conspiracy_sum `controls1' `controls2c' || lfdn: if exp_issuetype == 1
estimates store m3

*By political knowledge, experiments on foreign policy
mixed poolexp i.treat_exp##c.know_sum `controls1' `controls2d' || lfdn: if exp_issuetype == 1
estimates store m4

*By attitudes toward German government, experiments on foreign policy
mixed poolexp i.treat_exp##c.pred_bundes_gov_r `controls1' `controls2e' || lfdn: if exp_issuetype == 1
estimates store m5

*By attitudes toward Russia, experiments on foreign policy
mixed poolexp i.treat_exp##c.pred_Russia_r `controls1' `controls2f' || lfdn: if exp_issuetype == 1
estimates store m6


***************************************************************

*** Secion 2: Export tables, FOREIGN POLICY ONLY

***************************************************************

esttab 	m1 m2 m3 using "tableA19.tex", replace ///
		b(2) se(2) wide nogaps compress nobaselevels varwidth(15) ///
		modelwidth(6) nonumbers ///
		title("Regression table, FOREIGN POLICY EXPERIMENTS ONLY (Part 1)") ///
		mtitles("M1" "M2" "M3") ///
		refcat(2.treat_exp "Group 1: Control") ///
		coeflabels(2.treat_exp "Group 2: Russian frame" ///
					3.treat_exp "Group 3: Russian frame, sourced" ///
					4.treat_exp "Group 4: Western frame" ///
					5.treat_exp "Group 5: Western frame, sourced" ///
					authoritarian "Authoritarian beliefs" ///
					conspiracy_sum "Belief in conspiracy theory" ///
					know_sum "Political knowledge" ///
					pred_bundes_gov_r "Attitude twd German government" ///
					pred_Russia_r "Attitude twd Russia" ///
					2.treat_exp#c.authoritarian "T2 * Authoritarian beliefs" ///
					3.treat_exp#c.authoritarian "T3 * Authoritarian beliefs" ///
					4.treat_exp#c.authoritarian "T4 * Authoritarian beliefs" ///
					5.treat_exp#c.authoritarian "T5 * Authoritarian beliefs" ///
					2.treat_exp#c.conspiracy_sum "T2 * Belief in conspiracy theory" ///
					3.treat_exp#c.conspiracy_sum "T3 * Belief in conspiracy theory" ///
					4.treat_exp#c.conspiracy_sum "T4 * Belief in conspiracy theory" ///
					5.treat_exp#c.conspiracy_sum "T5 * Belief in conspiracy theory" ///
					age "Age" ///
					female "Gender (female)" ///
					educ_secondary "Education dummy: Secondary education" ///
					educ_prof_high "Education dummy: Applied sciences high school" ///
					educ_acad_high "Education dummy: Academic high school" ///
					2.exp "Experiment dummy: NATO in Eastern Europe" ///
					3.exp "Experiment dummy: Democracy export to Ukraine" ///
					4.exp "Experiment dummy: Schengen treaty" ///
					5.exp "Experiment dummy: German media hold back facts to protect foreign law-breakers" ///
					6.exp "Experiment dummy: NATO commitment to support Turkey" ///
					7.exp "Experiment dummy: German government too lenient" ///
					8.exp "Experiment dummy: Russia Panama Papers" ///
					_cons "Constant") ///
		order(2.treat_exp 3.treat_exp 4.treat_exp 5.treat_exp authoritarian 2.treat_exp#c.authoritarian 3.treat_exp#c.authoritarian 4.treat_exp#c.authoritarian 5.treat_exp#c.authoritarian conspiracy_sum 2.treat_exp#c.conspiracy_sum 3.treat_exp#c.conspiracy_sum 4.treat_exp#c.conspiracy_sum 5.treat_exp#c.conspiracy_sum know_sum pred_bundes_gov_r pred_Russia_r age female educ_secondary educ_prof_high educ_acad_high 2.exp 3.exp 8.exp)  ///
		transform(ln*: exp(@) exp(@)) ///
		eqlabels("" "sd(Respondent)" "sd(Residual)", none) 


esttab 	m4 m5 m6 using "tableA20.tex", replace ///
		b(2) se(2) wide nogaps compress nobaselevels varwidth(15) ///
		modelwidth(6) nonumbers nodepvars ///
		title("Regression table, FOREIGN POLICY EXPERIMENTS ONLY (Part 2)") ///
		mtitles("M4" "M5" "M6") ///
		refcat(2.treat_exp "Group 1: Control") ///
		coeflabels(2.treat_exp "Group 2: Russian frame" ///
					3.treat_exp "Group 3: Russian frame, sourced" ///
					4.treat_exp "Group 4: Western frame" ///
					5.treat_exp "Group 5: Western frame, sourced" ///
					authoritarian "Authoritarian beliefs" ///
					conspiracy_sum "Belief in conspiracy theory" ///
					know_sum "Political knowledge" ///
					pred_bundes_gov_r "Attitude twd German government" ///
					pred_Russia_r "Attitude twd Russia" ///
					2.treat_exp#c.know_sum  "T2 * Political knowledge" ///
					3.treat_exp#c.know_sum "T3 * Political knowledge" ///
					4.treat_exp#c.know_sum "T4 * Political knowledge" ///
					5.treat_exp#c.know_sum "T5 * Political knowledge" ///
					2.treat_exp#c.pred_bundes_gov_r "T2 * Attitude twd German government" ///
					3.treat_exp#c.pred_bundes_gov_r "T3 * Attitude twd German government" ///
					4.treat_exp#c.pred_bundes_gov_r "T4 * Attitude twd German government" ///
					5.treat_exp#c.pred_bundes_gov_r "T5 * Attitude twd German government" ///
					2.treat_exp#c.pred_Russia_r "T2 * Attitude twd Russia" ///
					3.treat_exp#c.pred_Russia_r "T3 * Attitude twd Russia" ///
					4.treat_exp#c.pred_Russia_r "T4 * Attitude twd Russia" ///
					5.treat_exp#c.pred_Russia_r "T5 * Attitude twd Russia" ///
					age "Age" ///
					female "Gender (female)" ///
					educ_secondary "Education dummy: Secondary education" ///
					educ_prof_high "Education dummy: Applied sciences high school" ///
					educ_acad_high "Education dummy: Academic high school" ///
					2.exp "Experiment dummy: NATO in Eastern Europe" ///
					3.exp "Experiment dummy: Democracy export to Ukraine" ///
					4.exp "Experiment dummy: Schengen treaty" ///
					5.exp "Experiment dummy: German media hold back facts to protect foreign law-breakers" ///
					6.exp "Experiment dummy: NATO commitment to support Turkey" ///
					7.exp "Experiment dummy: German government too lenient" ///
					8.exp "Experiment dummy: Russia Panama Papers" ///
					_cons "Constant") ///
		order(2.treat_exp 3.treat_exp 4.treat_exp 5.treat_exp authoritarian conspiracy_sum know_sum 2.treat_exp#c.know_sum 3.treat_exp#c.know_sum 4.treat_exp#c.know_sum 5.treat_exp#c.know_sum pred_bundes_gov_r 2.treat_exp#c.pred_bundes_gov_r 3.treat_exp#c.pred_bundes_gov_r 4.treat_exp#c.pred_bundes_gov_r 5.treat_exp#c.pred_bundes_gov_r pred_Russia_r 2.treat_exp#c.pred_Russia_r 3.treat_exp#c.pred_Russia_r 4.treat_exp#c.pred_Russia_r	5.treat_exp#c.pred_Russia_r age female educ_secondary educ_prof_high educ_acad_high 2.exp 3.exp 8.exp)  ///
		transform(ln*: exp(@) exp(@)) ///
		eqlabels("" "sd(Respondent)" "sd(Residual)", none)


***************************************************************

*** Secion 3: Export tables, DOMESTIC POLICY / IO ONLY

***************************************************************

*Average effect, experiments on domestic policy / IOs
mixed poolexp i.treat_exp `controls1' `controls2a' || lfdn: if exp_issuetype == 0
estimates store m7


*By authoritarian beliefs, experiments on domestic policy / IOs
mixed poolexp i.treat_exp##c.authoritarian `controls1' `controls2b' || lfdn: if exp_issuetype == 0
estimates store m8

*By conspiracy theory beliefs, experiments on domestic policy / IOs
mixed poolexp i.treat_exp##c.conspiracy_sum `controls1' `controls2c' || lfdn: pred_Russia_r if exp_issuetype == 0
estimates store m9

*By political knowledge, experiments on domestic policy / IOs
mixed poolexp i.treat_exp##c.know_sum `controls1' `controls2d' || lfdn: if exp_issuetype == 0
estimates store m10

*By attitudes toward German government, experiments on domestic policy / IOs
mixed poolexp i.treat_exp##c.pred_bundes_gov_r `controls1' `controls2e' || lfdn: if exp_issuetype == 0
estimates store m11

*By attitudes toward Russia, experiments on domestic policy / IOs
mixed poolexp i.treat_exp##c.pred_Russia_r `controls1' `controls2f' || lfdn: if exp_issuetype == 0
estimates store m12



***************************************************************

*** Secion 4: Export tables, DOMESTIC POLICY / IO ONLY

***************************************************************

esttab 	m7 m8 m9 using "tableA21.tex", replace ///
		b(2) se(2) wide nogaps compress nobaselevels varwidth(15) ///
		modelwidth(6) nonumbers ///
		title("Regression table, DOMESTIC POLICY / IO EXPERIMENTS ONLY (Part 1)") ///
		mtitles("M1" "M2" "M3") ///
		refcat(2.treat_exp "Group 1: Control") ///
		coeflabels(2.treat_exp "Group 2: Russian frame" ///
					3.treat_exp "Group 3: Russian frame, sourced" ///
					4.treat_exp "Group 4: Western frame" ///
					5.treat_exp "Group 5: Western frame, sourced" ///
					authoritarian "Authoritarian beliefs" ///
					conspiracy_sum "Belief in conspiracy theory" ///
					know_sum "Political knowledge" ///
					pred_bundes_gov_r "Attitude twd German government" ///
					pred_Russia_r "Attitude twd Russia" ///
					2.treat_exp#c.authoritarian "T2 * Authoritarian beliefs" ///
					3.treat_exp#c.authoritarian "T3 * Authoritarian beliefs" ///
					4.treat_exp#c.authoritarian "T4 * Authoritarian beliefs" ///
					5.treat_exp#c.authoritarian "T5 * Authoritarian beliefs" ///
					2.treat_exp#c.conspiracy_sum "T2 * Belief in conspiracy theory" ///
					3.treat_exp#c.conspiracy_sum "T3 * Belief in conspiracy theory" ///
					4.treat_exp#c.conspiracy_sum "T4 * Belief in conspiracy theory" ///
					5.treat_exp#c.conspiracy_sum "T5 * Belief in conspiracy theory" ///
					age "Age" ///
					female "Gender (female)" ///
					educ_secondary "Education dummy: Secondary education" ///
					educ_prof_high "Education dummy: Applied sciences high school" ///
					educ_acad_high "Education dummy: Academic high school" ///
					2.exp "Experiment dummy: NATO in Eastern Europe" ///
					3.exp "Experiment dummy: Democracy export to Ukraine" ///
					4.exp "Experiment dummy: Schengen treaty" ///
					5.exp "Experiment dummy: German media hold back facts to protect foreign law-breakers" ///
					6.exp "Experiment dummy: NATO commitment to support Turkey" ///
					7.exp "Experiment dummy: German government too lenient" ///
					_cons "Constant") ///
		order(2.treat_exp 3.treat_exp 4.treat_exp 5.treat_exp authoritarian 2.treat_exp#c.authoritarian 3.treat_exp#c.authoritarian 4.treat_exp#c.authoritarian 5.treat_exp#c.authoritarian conspiracy_sum 2.treat_exp#c.conspiracy_sum 3.treat_exp#c.conspiracy_sum 4.treat_exp#c.conspiracy_sum 5.treat_exp#c.conspiracy_sum know_sum pred_bundes_gov_r pred_Russia_r age female educ_secondary educ_prof_high educ_acad_high 5.exp 6.exp 7.exp)  ///
		transform(ln*: exp(@) exp(@)) ///
		eqlabels("" "sd(Respondent)" "sd(Residual)", none)

esttab 	m10 m11 m12 using "tableA22.tex", replace ///
		b(2) se(2) wide nogaps compress nobaselevels varwidth(15) ///
		modelwidth(6) nonumbers nodepvars ///
		title("Regression table, DOMESTIC POLICY / IO EXPERIMENTS ONLY (Part 2)") ///
		mtitles("M4" "M5" "M6") ///
		refcat(2.treat_exp "Group 1: Control") ///
		coeflabels(2.treat_exp "Group 2: Russian frame" ///
					3.treat_exp "Group 3: Russian frame, sourced" ///
					4.treat_exp "Group 4: Western frame" ///
					5.treat_exp "Group 5: Western frame, sourced" ///
					authoritarian "Authoritarian beliefs" ///
					conspiracy_sum "Belief in conspiracy theory" ///
					know_sum "Political knowledge" ///
					pred_bundes_gov_r "Attitude twd German government" ///
					pred_Russia_r "Attitude twd Russia" ///
					2.treat_exp#c.know_sum  "T2 * Political knowledge" ///
					3.treat_exp#c.know_sum "T3 * Political knowledge" ///
					4.treat_exp#c.know_sum "T4 * Political knowledge" ///
					5.treat_exp#c.know_sum "T5 * Political knowledge" ///
					2.treat_exp#c.pred_bundes_gov_r "T2 * Attitude twd German government" ///
					3.treat_exp#c.pred_bundes_gov_r "T3 * Attitude twd German government" ///
					4.treat_exp#c.pred_bundes_gov_r "T4 * Attitude twd German government" ///
					5.treat_exp#c.pred_bundes_gov_r "T5 * Attitude twd German government" ///
					2.treat_exp#c.pred_Russia_r "T2 * Attitude twd Russia" ///
					3.treat_exp#c.pred_Russia_r "T3 * Attitude twd Russia" ///
					4.treat_exp#c.pred_Russia_r "T4 * Attitude twd Russia" ///
					5.treat_exp#c.pred_Russia_r "T5 * Attitude twd Russia" ///
					age "Age" ///
					female "Gender (female)" ///
					educ_secondary "Education dummy: Secondary education" ///
					educ_prof_high "Education dummy: Applied sciences high school" ///
					educ_acad_high "Education dummy: Academic high school" ///
					2.exp "Experiment dummy: NATO in Eastern Europe" ///
					3.exp "Experiment dummy: Democracy export to Ukraine" ///
					4.exp "Experiment dummy: Schengen treaty" ///
					5.exp "Experiment dummy: German media hold back facts to protect foreign law-breakers" ///
					6.exp "Experiment dummy: NATO commitment to support Turkey" ///
					7.exp "Experiment dummy: German government too lenient" ///
					8.exp "Experiment dummy: Russia Panama Papers" ///
					_cons "Constant") ///
		order(2.treat_exp 3.treat_exp 4.treat_exp 5.treat_exp authoritarian conspiracy_sum know_sum 2.treat_exp#c.know_sum 3.treat_exp#c.know_sum 4.treat_exp#c.know_sum 5.treat_exp#c.know_sum pred_bundes_gov_r 2.treat_exp#c.pred_bundes_gov_r 3.treat_exp#c.pred_bundes_gov_r 4.treat_exp#c.pred_bundes_gov_r 5.treat_exp#c.pred_bundes_gov_r pred_Russia_r 2.treat_exp#c.pred_Russia_r 3.treat_exp#c.pred_Russia_r 4.treat_exp#c.pred_Russia_r	5.treat_exp#c.pred_Russia_r age female educ_secondary educ_prof_high educ_acad_high 5.exp 6.exp 7.exp)  ///
		transform(ln*: exp(@) exp(@)) ///
		eqlabels("" "sd(Respondent)" "sd(Residual)", none)
